package redis

import (
	"fmt"
	"github.com/go-redis/redis"
)

var (
	RDB *redis.Client
	err error
)

func RedisInit(addr string, password string, db int) *redis.Client {
	RDB = redis.NewClient(&redis.Options{
		Addr:     addr,
		Password: password,
		DB:       db,
	})
	err = RDB.Ping().Err()
	if err != nil {
		fmt.Sprintf("redis is error:%v", err)
	}
	return RDB
}
